import http from '@/utils/request'

// 登录
export const loginApi = (data) => {
  return http({
    url: '/api/login',
    method: 'post',
    data
  })
}

// 注册
export const registerApi = (data) => {
  return http({
    url: '/api/reg',
    method: 'post',
    data
  })
}

//对外暴露获取用户信息的函数
export function getInfoApi(token) {
  return http({
    url: '/my/userinfo',
    method: 'get',
    params: { token }
  })
}